﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using Assist;
using YArchitech.Controls;
using YArchitech.Electric;
using YArchitech.LIB;
using HYCodeBase.XmlUtility;

namespace HYElectricDim
{
	public partial class CableTrenchSectionForm : System.Windows.Forms.Form
	{
		public CableTrenchSectionForm()
		{
			this.InitializeComponent();
			try
			{
				string str = Path.Combine(Product.InstallLocation, "EquipmentImage", "ElectricImage");
				for (int i = 0; i < 16; i++)
				{
					this.m_lstImgPreview.Add(Image.FromFile(str + "\\" + i.ToString() + ".gif"));
				}
			}
			catch
			{
				YJKMessageBox.Show("预览图加载失败");
			}
			this.InitalPlanData();
			this.UpdatePlanList();
			this.lstPlan.SelectedIndex = 0;
			CableTrenchInfo cableTrenchInfo = this.m_dicPlan[this.lstPlan.SelectedItem.ToString()];
			this.m_TemplePlan = (cableTrenchInfo.Clone() as CableTrenchInfo);
			this.propertyGrid1.SelectedObject = this.m_TemplePlan;
			this.cmbRatio.Text = "1:100";
		}

		private void RefreshPreiview()
		{
			int num = 0;
			if (this.m_TemplePlan.EmbedSteel == "是")
			{
				num = 1;
			}
			if (this.m_TemplePlan.EmbedSteel == "否" && this.m_TemplePlan.GroundSteel == "是")
			{
				num = 2;
			}
			if (this.m_TemplePlan.EmbedSteel == "是" && this.m_TemplePlan.GroundSteel == "是")
			{
				num = 3;
			}
			if (this.m_TemplePlan.HasBoard == "是")
			{
				num += 4;
			}
			if (this.m_TemplePlan.HasBoard == "否" && this.m_TemplePlan.HasCableTray == "是")
			{
				num += 8;
			}
			if (this.m_TemplePlan.HasBoard == "是" && this.m_TemplePlan.HasCableTray == "是")
			{
				num += 8;
			}
			this.picPreview.Image = this.m_lstImgPreview[num];
			if (this.m_TemplePlan.HasBoard == "否")
			{
				this.SetPropertyReadOnly(this.m_TemplePlan, "BoardThick", true);
			}
			else
			{
				this.SetPropertyReadOnly(this.m_TemplePlan, "BoardThick", false);
			}
			if (this.m_TemplePlan.HasCableTray == "否")
			{
				this.SetPropertyReadOnly(this.m_TemplePlan, "TrayWidth", true);
				this.SetPropertyReadOnly(this.m_TemplePlan, "TrayHeight", true);
				return;
			}
			this.SetPropertyReadOnly(this.m_TemplePlan, "TrayWidth", false);
			this.SetPropertyReadOnly(this.m_TemplePlan, "TrayHeight", false);
		}

		private void InitalPlanData()
		{
			string sourceFileName = Path.Combine(Product.DataLocation, "ElectricalData", "CableTrenchSectionData.xml");
			string text = Path.Combine(Product.WorkingLocation, "CableTrenchSectionData.xml");
			if (!File.Exists(text))
			{
				File.Copy(sourceFileName, text);
			}
			this.xmlHelper.LoadXml(text, "CabelTrenchSection");
			if (this.xmlHelper == null)
			{
				YJKMessageBox.Show("加载方案文件出错");
				return;
			}
			foreach (XmlElement xmlElement in this.xmlHelper.GetElements())
			{
				string attribute = xmlElement.GetAttribute("Name");
				CableTrenchInfo cableTrenchInfo = new CableTrenchInfo();
				foreach (object obj in xmlElement.SelectNodes("Category"))
				{
					XmlNode xmlNode = (XmlNode)obj;
					string attribute2 = (xmlNode as XmlElement).GetAttribute("Name");
					if (attribute2 == "沟体")
					{
						IEnumerator enumerator3 = xmlNode.SelectNodes("Item").GetEnumerator();
						{
							while (enumerator3.MoveNext())
							{
								object obj2 = enumerator3.Current;
								XmlElement xmlElement2 = ((XmlNode)obj2) as XmlElement;
								string attribute3 = xmlElement2.GetAttribute("Name");
								if (attribute3 == "宽度")
								{
									cableTrenchInfo.Width = Convert.ToInt32(xmlElement2.GetAttribute("Value"));
								}
								else if (attribute3 == "深度")
								{
									cableTrenchInfo.Depth = Convert.ToInt32(xmlElement2.GetAttribute("Value"));
								}
								else if (attribute3 == "墙厚")
								{
									cableTrenchInfo.WallThick = Convert.ToInt32(xmlElement2.GetAttribute("Value"));
								}
								else if (attribute3 == "壁厚")
								{
									cableTrenchInfo.DisThick = Convert.ToInt32(xmlElement2.GetAttribute("Value"));
								}
								else if (attribute3 == "预埋钢筋")
								{
									cableTrenchInfo.EmbedSteel = xmlElement2.GetAttribute("Value");
								}
								else if (attribute3 == "接地扁钢")
								{
									cableTrenchInfo.GroundSteel = xmlElement2.GetAttribute("Value");
								}
							}
							continue;
						}
					}
					if (attribute2 == "支架")
					{
						IEnumerator enumerator3 = xmlNode.SelectNodes("Item").GetEnumerator();
						{
							while (enumerator3.MoveNext())
							{
								object obj3 = enumerator3.Current;
								XmlElement xmlElement3 = ((XmlNode)obj3) as XmlElement;
								string attribute4 = xmlElement3.GetAttribute("Name");
								if (attribute4 == "长度")
								{
									cableTrenchInfo.Length = Convert.ToInt32(xmlElement3.GetAttribute("Value"));
								}
								else if (attribute4 == "层数")
								{
									cableTrenchInfo.FloorNum = Convert.ToInt32(xmlElement3.GetAttribute("Value"));
								}
								else if (attribute4 == "层间距")
								{
									cableTrenchInfo.FloorGap = Convert.ToInt32(xmlElement3.GetAttribute("Value"));
								}
								else if (attribute4 == "顶距")
								{
									cableTrenchInfo.TopDis = Convert.ToInt32(xmlElement3.GetAttribute("Value"));
								}
								else if (attribute4 == "左右支架")
								{
									cableTrenchInfo.LeftOrRight = xmlElement3.GetAttribute("Value");
								}
							}
							continue;
						}
					}
					if (attribute2 == "盖板")
					{
						IEnumerator enumerator3 = xmlNode.SelectNodes("Item").GetEnumerator();
						{
							while (enumerator3.MoveNext())
							{
								object obj4 = enumerator3.Current;
								XmlElement xmlElement4 = ((XmlNode)obj4) as XmlElement;
								string attribute5 = xmlElement4.GetAttribute("Name");
								if (attribute5 == "加盖板")
								{
									cableTrenchInfo.HasBoard = xmlElement4.GetAttribute("Value");
								}
								else if (attribute5 == "厚度")
								{
									cableTrenchInfo.BoardThick = Convert.ToInt32(xmlElement4.GetAttribute("Value"));
								}
							}
							continue;
						}
					}
					if (attribute2 == "基础")
					{
						IEnumerator enumerator3 = xmlNode.SelectNodes("Item").GetEnumerator();
						{
							while (enumerator3.MoveNext())
							{
								object obj5 = enumerator3.Current;
								XmlElement xmlElement5 = ((XmlNode)obj5) as XmlElement;
								string attribute6 = xmlElement5.GetAttribute("Name");
								if (attribute6 == "厚度")
								{
									cableTrenchInfo.BaseThick = Convert.ToInt32(xmlElement5.GetAttribute("Value"));
								}
								else if (attribute6 == "边距")
								{
									cableTrenchInfo.EdgeDis = Convert.ToInt32(xmlElement5.GetAttribute("Value"));
								}
							}
							continue;
						}
					}
					if (attribute2 == "桥架")
					{
						IEnumerator enumerator3 = xmlNode.SelectNodes("Item").GetEnumerator();
						{
							while (enumerator3.MoveNext())
							{
								object obj6 = enumerator3.Current;
								XmlElement xmlElement6 = ((XmlNode)obj6) as XmlElement;
								string attribute7 = xmlElement6.GetAttribute("Name");
								if (attribute7 == "带桥架")
								{
									cableTrenchInfo.HasCableTray = xmlElement6.GetAttribute("Value");
								}
								else if (attribute7 == "宽度")
								{
									cableTrenchInfo.TrayWidth = Convert.ToInt32(xmlElement6.GetAttribute("Value"));
								}
								else if (attribute7 == "高度")
								{
									cableTrenchInfo.TrayHeight = Convert.ToInt32(xmlElement6.GetAttribute("Value"));
								}
							}
							continue;
						}
					}
					if (attribute2 == "绘制设定")
					{
						foreach (object obj7 in xmlNode.SelectNodes("Item"))
						{
							XmlElement xmlElement7 = ((XmlNode)obj7) as XmlElement;
							string attribute8 = xmlElement7.GetAttribute("Name");
							if (attribute8 == "带标注")
							{
								cableTrenchInfo.HasLabel = xmlElement7.GetAttribute("Value");
							}
							else if (attribute8 == "放大系数")
							{
								cableTrenchInfo.Gain = Convert.ToDouble(xmlElement7.GetAttribute("Value"));
							}
						}
					}
				}
				this.m_dicPlan.Add(attribute, cableTrenchInfo);
			}
		}

		private void UpdatePlanList()
		{
			if (this.m_dicPlan.Count <= 0)
			{
				return;
			}
			this.lstPlan.Items.Clear();
			foreach (KeyValuePair<string, CableTrenchInfo> keyValuePair in this.m_dicPlan)
			{
				this.lstPlan.Items.Add(keyValuePair.Key);
			}
		}

		private void btnEdit_Click(object sender, EventArgs e)
		{
			if (this.lstPlan.SelectedItem == null)
			{
				YJKMessageBox.Show("请选择一个方案");
				return;
			}
			string text = this.lstPlan.SelectedItem.ToString();
			CableTrenchPlanEdit cableTrenchPlanEdit = new CableTrenchPlanEdit(text, false);
			if (cableTrenchPlanEdit.ShowDialog() != DialogResult.OK)
			{
				return;
			}
			string planName = cableTrenchPlanEdit.planName;
			if (!this.m_dicPlan.ContainsKey(planName))
			{
				CableTrenchInfo cableTrenchInfo = this.m_dicPlan[text];
				this.m_dicPlan.Remove(text);
				this.m_dicPlan.Add(planName, cableTrenchInfo);
				this.UpdatePlanList();
				return;
			}
			YJKMessageBox.Show("该方案名已经存在，请重新输入");
		}

		private void btnCopy_Click(object sender, EventArgs e)
		{
			if (this.lstPlan.SelectedItem == null)
			{
				YJKMessageBox.Show("请选择一个方案");
				return;
			}
			string text = this.lstPlan.SelectedItem.ToString();
			CableTrenchPlanEdit cableTrenchPlanEdit = new CableTrenchPlanEdit(text + "[副本]", true);
			if (cableTrenchPlanEdit.ShowDialog() != DialogResult.OK)
			{
				return;
			}
			string planName = cableTrenchPlanEdit.planName;
			if (!this.m_dicPlan.ContainsKey(planName))
			{
				CableTrenchInfo cableTrenchInfo = this.m_dicPlan[text].Clone() as CableTrenchInfo;
				this.m_dicPlan.Add(planName, cableTrenchInfo);
				this.lstPlan.Items.Add(planName);
				this.UpdatePlanList();
				return;
			}
			YJKMessageBox.Show("该方案名已经存在，请重新输入");
		}

		private void btnDelete_Click(object sender, EventArgs e)
		{
			if (this.lstPlan.Items.Count == 1)
			{
				YJKMessageBox.Show("请至少保留一个剖面方案");
				return;
			}
			if (this.lstPlan.SelectedItem == null)
			{
				YJKMessageBox.Show("请选择一个方案");
				return;
			}
			string key = this.lstPlan.SelectedItem.ToString();
			if (this.m_dicPlan.ContainsKey(key))
			{
				this.m_dicPlan.Remove(key);
				this.lstPlan.Items.Remove(key);
				this.UpdatePlanList();
				if (this.lstPlan.Items.Count > 0)
				{
					this.lstPlan.SelectedIndex = 0;
				}
			}
		}

		private void btnSave_Click(object sender, EventArgs e)
		{
			string key = this.lstPlan.SelectedItem.ToString();
			CableTrenchInfo cableTrenchInfo = this.m_dicPlan[key];
			cableTrenchInfo = (this.m_TemplePlan.Clone() as CableTrenchInfo);
			this.m_dicPlan.Remove(key);
			this.m_dicPlan.Add(key, cableTrenchInfo);
		}

		private void btnDraw_Click(object sender, EventArgs e)
		{
			this.m_nRatio = Convert.ToInt32(this.cmbRatio.Text.Substring(2));
			base.DialogResult = DialogResult.OK;
		}

		private void lstPlan_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.lstPlan.SelectedItem == null)
			{
				return;
			}
			string key = this.lstPlan.SelectedItem.ToString();
			CableTrenchInfo cableTrenchInfo = this.m_dicPlan[key];
			this.m_TemplePlan = (cableTrenchInfo.Clone() as CableTrenchInfo);
			this.propertyGrid1.SelectedObject = this.m_TemplePlan;
			this.RefreshPreiview();
			this.propertyGrid1.Refresh();
		}

		private void CableTrenchSectionForm_Load(object sender, EventArgs e)
		{
			this.toolTip1.SetToolTip(this.btnEdit, "编辑方案名称");
			this.toolTip1.SetToolTip(this.btnCopy, "添加方案");
			this.toolTip1.SetToolTip(this.btnDelete, "删除方案");
			this.toolTip1.SetToolTip(this.btnSave, "更新方案");
			this.btnEdit.Image = YArchitech.Electric.Resources.GetImage("ReName20");
			this.btnCopy.Image = YArchitech.Electric.Resources.GetImage("Add20");
			this.btnDelete.Image = YArchitech.Electric.Resources.GetImage("Delete20");
			this.btnSave.Image = YArchitech.Electric.Resources.GetImage("Save16");
			base.Icon = Resource.YArchitechIcon;
		}

		private void SaveCableTrenchInfo()
		{
			if (this.xmlHelper == null)
			{
				return;
			}
			XmlElement xmlRootNode = this.xmlHelper.XmlRootNode;
			xmlRootNode.RemoveAll();
			foreach (KeyValuePair<string, CableTrenchInfo> keyValuePair in this.m_dicPlan)
			{
				string key = keyValuePair.Key;
				CableTrenchInfo cableTrenchInfo = keyValuePair.Value;
				XmlElement xmlElement = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlRootNode, "Plan");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement, "Name", key);
				XmlElement xmlElement2 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement2, "Name", "沟体");
				XmlElement node = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node, "Name", "宽度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node, "Value", cableTrenchInfo.Width.ToString());
				XmlElement node2 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node2, "Name", "深度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node2, "Value", cableTrenchInfo.Depth.ToString());
				XmlElement node3 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node3, "Name", "墙厚");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node3, "Value", cableTrenchInfo.WallThick.ToString());
				XmlElement node4 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node4, "Name", "壁厚");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node4, "Value", cableTrenchInfo.DisThick.ToString());
				XmlElement node5 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node5, "Name", "预埋钢筋");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node5, "Value", cableTrenchInfo.EmbedSteel.ToString());
				XmlElement node6 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement2, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node6, "Name", "接地扁钢");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node6, "Value", cableTrenchInfo.GroundSteel.ToString());
				XmlElement xmlElement3 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement3, "Name", "支架");
				XmlElement node7 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement3, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node7, "Name", "长度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node7, "Value", cableTrenchInfo.Length.ToString());
				XmlElement node8 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement3, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node8, "Name", "层数");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node8, "Value", cableTrenchInfo.FloorNum.ToString());
				XmlElement node9 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement3, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node9, "Name", "层间距");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node9, "Value", cableTrenchInfo.FloorGap.ToString());
				XmlElement node10 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement3, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node10, "Name", "顶距");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node10, "Value", cableTrenchInfo.TopDis.ToString());
				XmlElement node11 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement3, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node11, "Name", "左右支架");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node11, "Value", cableTrenchInfo.LeftOrRight);
				XmlElement xmlElement4 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement4, "Name", "盖板");
				XmlElement node12 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement4, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node12, "Name", "加盖板");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node12, "Value", cableTrenchInfo.HasBoard.ToString());
				XmlElement node13 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement4, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node13, "Name", "厚度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node13, "Value", cableTrenchInfo.BoardThick.ToString());
				XmlElement xmlElement5 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement5, "Name", "基础");
				XmlElement node14 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement5, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node14, "Name", "厚度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node14, "Value", cableTrenchInfo.BaseThick.ToString());
				XmlElement node15 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement5, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node15, "Name", "边距");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node15, "Value", cableTrenchInfo.EdgeDis.ToString());
				XmlElement xmlElement6 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement6, "Name", "桥架");
				XmlElement node16 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement6, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node16, "Name", "带桥架");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node16, "Value", cableTrenchInfo.HasCableTray.ToString());
				XmlElement node17 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement6, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node17, "Name", "宽度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node17, "Value", cableTrenchInfo.TrayWidth.ToString());
				XmlElement node18 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement6, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node18, "Name", "高度");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node18, "Value", cableTrenchInfo.TrayHeight.ToString());
				XmlElement xmlElement7 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement, "Category");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(xmlElement7, "Name", "绘制设定");
				XmlElement node19 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement7, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node19, "Name", "带标注");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node19, "Value", cableTrenchInfo.HasLabel.ToString());
				XmlElement node20 = HYCodeBase.XmlUtility.XmlHelper.AddElement(xmlElement7, "Item");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node20, "Name", "放大系数");
				HYCodeBase.XmlUtility.XmlHelper.SetAttribute(node20, "Value", cableTrenchInfo.Gain.ToString());
			}
			this.xmlHelper.SaveXml("");
		}

		private void CableTrenchSectionForm_FormClosed(object sender, FormClosedEventArgs e)
		{
			this.SaveCableTrenchInfo();
		}

		private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
		{
			string a = e.ChangedItem.PropertyDescriptor.Name;
			if (a == "BoardThick" && (double)Convert.ToInt32(e.ChangedItem.Value) - 150.0 > 0.0)
			{
				YJKMessageBox.Show("电缆沟剖面图参数设置不合理，请重新设置");
				this.m_TemplePlan.BoardThick = Convert.ToInt32(e.OldValue);
			}
			if (a == "EmbedSteel" || a == "GroundSteel" || a == "HasBoard" || a == "HasCableTray")
			{
				this.RefreshPreiview();
			}
		}

		private void SetPropertyReadOnly(object obj, string propertyName, bool readOnly)
		{
			Type typeFromHandle = typeof(ReadOnlyAttribute);
			AttributeCollection attributes = TypeDescriptor.GetProperties(obj)[propertyName].Attributes;
			typeFromHandle.GetField("isReadOnly", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance).SetValue(attributes[typeFromHandle], readOnly);
		}

		public CableTrenchInfo m_TemplePlan;

		public int m_nRatio;

		private Dictionary<string, CableTrenchInfo> m_dicPlan = new Dictionary<string, CableTrenchInfo>();

		private HYCodeBase.XmlUtility.XmlHelper xmlHelper = new HYCodeBase.XmlUtility.XmlHelper();

		private const string root = "CabelTrenchSection";

		private const string plan = "Plan";

		private const string category = "Category";

		private const string item = "Item";

		private const string name = "Name";

		private const string value = "Value";

		private List<Image> m_lstImgPreview = new List<Image>();
	}
}
